﻿using Basic.FlowCollect;
using Basic.FlowLocalEvent.Model;
using WeDonekRpc.Client.Attr;
using WeDonekRpc.Client.Interface;

namespace Basic.FlowLocalEvent.FlowNode
{
    [LocalEventName("Delete")]
    internal class ClearNodeEvent : IEventHandler<FlowNodeEvent>
    {
        private readonly INodeEventCollect _NodeEvent;

        public ClearNodeEvent ( INodeEventCollect nodeEvent )
        {
            this._NodeEvent = nodeEvent;
        }

        public void HandleEvent ( FlowNodeEvent data, string eventName )
        {
            this._NodeEvent.Clear(data.Node.FlowId, data.Node.Id);
        }
    }
}
